home *** CD-ROM | disk | FTP | other *** search
- property mySprite, myType, myName, myNameDown, myNameOver, myNameInactive, Active, ancestor, FloorPlanDisplaySprite, tileSprite, myTileState
-
- on beginSprite me
- global gActorListMan
- mySprite = me.spriteNum
- myName = (the member of sprite mySprite).name
- myNameDown = word 1 of myName && "down"
- myNameOver = word 1 of myName && "over"
- myNameInactive = word 1 of myName && "Inactive"
- Active = 1
- myTileState = #off
- lookForToolTip = 1
- ancestor = new(script("FourStatebuttonActions"), lookForToolTip)
- myType = #planButton
- registerSprite(gActorListMan, mySprite)
- end
-
- on mouseUp me
- global gClickSprite
- if not Active then
- exit
- end if
- if gClickSprite = mySprite then
- if voidp(FloorPlanDisplaySprite) then
- FloorPlanDisplaySprite = sendAllSprites(#sendSpriteNum, #FloorPlanDisplay)
- tileSprite = sendAllSprites(#sendSpriteNum, #tileSprite)
- end if
- tileState = sendSprite(tileSprite, #getState)
- doButtonUpClick(myType, 1)
- if tileState = #on then
- else
- sendSprite(tileSprite, #turnOn)
- TileName = sendAllSprites(#sendTileName, #FloorPlanDisplay)
- sendSprite(tileSprite, #setTile, TileName)
- myTileState = #on
- end if
- end if
- end
-
- on getTileState me
- return myTileState
- end
-
- on endSprite me
- global gActorListMan
- unRegisterSprite(gActorListMan, mySprite)
- end
-
- on sendSpriteNum me, aType
- if aType = myType then
- return mySprite
- end if
- end
-